package top.huhuiyu.spirngboot2.total.dao.menu;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import top.huhuiyu.spirngboot2.total.entity.menu.TbMenus;
import top.huhuiyu.spirngboot2.total.entity.menu.TbUserMenus;

import java.util.List;

@Mapper
public interface TbMenusDAO extends BaseMapper<TbMenus> {

    @Select("\n" + "select * from tb_menus \n" + "where pid = #{pid} and mid in (\n" + "\tselect mid from tb_user_menus \n" + "\twhere rid = #{rid}\n" + ")")
    public List<TbMenus> queryByPid(@Param("pid") Integer pid, @Param("rid") Integer rid);
}
